3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
QuickDraw 3D supports two tools, which you can call only from a renderer plug-in module, that provide fast access to geometry attribute sets.
You can use the Q3XAttributeSet_GetPointer function to obtain a pointer to QuickDraw 3D's internal data structure for elements and attributes in an attribute set.
void *Q3XAttributeSet_GetPointer (
TQ3AttributeSet attributeSet,
TQ3AttributeType attributeType);
The Q3XAttributeSet_GetPointer function returns a pointer to internal data structure for elements and attributes in the attribute set designated by attributeSet, of the type designated by attributeType. It returns null if no such attribute set data structure exists. Q3XAttributeSet_GetPointer uses the same internal data structure as Q3AttributeSet_Add , described on [link] .
A renderer can use the Q3XAttributeSet_GetMask function to obtain a set of masks for the internal data structure returned by Q3XAttributeSet_GetPointer.
TQ3XAttributeMask Q3XAttributeSet_GetMask (
TQ3AttributeSet attributeSet);
typedef unsigned long TQ3XAttributeMask;
To determine which attributes are present in an attribute set, a renderer can obtain a set of the masks by calling Q3XAttributeSet_GetMask. It returns the masks for the attribute set designated by attributeSet as an unsigned long value.
The returned mask values are as follows:
#define kQ3XAttributeMaskNone 0L
#define kQ3XAttributeMaskSurfaceUV (1 << (kQ3AttributeTypeSurfaceUV - 1))
#define kQ3XAttributeMaskShadingUV (1 << (kQ3AttributeTypeShadingUV - 1))
#define kQ3XAttributeMaskNormal (1 << (kQ3AttributeTypeNormal - 1))
#define kQ3XAttributeMaskAmbientCoefficient
(1 << (kQ3AttributeTypeAmbientCoefficient - 1))
#define kQ3XAttributeMaskDiffuseColor
(1 << (kQ3AttributeTypeDiffuseColor - 1))
#define kQ3XAttributeMaskSpecularColor
(1 << (kQ3AttributeTypeSpecularColor - 1))
#define kQ3XAttributeMaskSpecularControl
(1 << (kQ3AttributeTypeSpecularControl - 1))
#define kQ3XAttributeMaskTransparencyColor
(1 << (kQ3AttributeTypeTransparencyColor - 1))
#define kQ3XAttributeMaskSurfaceTangent
(1 << (kQ3AttributeTypeSurfaceTangent - 1))
#define kQ3XAttributeMaskHighlightState
(1 << (kQ3AttributeTypeHighlightState - 1))
#define kQ3XAttributeMaskSurfaceShader
(1 << (kQ3AttributeTypeSurfaceShader - 1))
#define kQ3XAttributeMaskCustomAttribute 0x80000000
#define kQ3XAttributeMaskAll
( kQ3XAttributeMaskSurfaceUV
| kQ3XAttributeMaskShadingUV
| kQ3XAttributeMaskNormal
| kQ3XAttributeMaskAmbientCoefficient
| kQ3XAttributeMaskDiffuseColor
| kQ3XAttributeMaskSpecularColor
| kQ3XAttributeMaskSpecularControl
| kQ3XAttributeMaskTransparencyColor
| kQ3XAttributeMaskSurfaceTangent
| kQ3XAttributeMaskHighlightState
| kQ3XAttributeMaskSurfaceShader
| kQ3XAttributeMaskCustomAttribute )
#define kQ3XAttributeMaskInherited
( kQ3XAttributeMaskSurfaceUV
| kQ3XAttributeMaskShadingUV
| kQ3XAttributeMaskNormal
| kQ3XAttributeMaskAmbientCoefficient
| kQ3XAttributeMaskDiffuseColor
| kQ3XAttributeMaskSpecularColor
| kQ3XAttributeMaskSpecularControl
| kQ3XAttributeMaskTransparencyColor
| kQ3XAttributeMaskSurfaceTangent
| kQ3XAttributeMaskHighlightState
| kQ3XAttributeMaskSurfaceShader
| kQ3XAttributeMaskCustomAttribute )
#define kQ3XAttributeMaskInterpolated
( kQ3XAttributeMaskSurfaceUV
| kQ3XAttributeMaskShadingUV
| kQ3XAttributeMaskNormal
| kQ3XAttributeMaskAmbientCoefficient
| kQ3XAttributeMaskDiffuseColor
| kQ3XAttributeMaskSpecularColor
| kQ3XAttributeMaskSpecularControl
| kQ3XAttributeMaskTransparencyColor
| kQ3XAttributeMaskSurfaceTangent )
Previous | QD3D Book | Overview | Chapter Contents | Next |